class PoliticasProveedorController < ApplicationController
	layout 'proveedores'
  # GET /politicas_proveedor
  # GET /politicas_proveedor.xml
  def index
    @politicas_proveedor = PoliticaProveedor.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @politicas_proveedor.to_xml }
    end
  end

  # GET /politicas_proveedor/1
  # GET /politicas_proveedor/1.xml
  def show
    @politica_proveedor = PoliticaProveedor.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @politica_proveedor.to_xml }
    end
  end

  # GET /politicas_proveedor/new
  def new
    @politica_proveedor = PoliticaProveedor.new(:proveedor_id=>params[:proveedor_id])
  end

  # GET /politicas_proveedor/1;edit
  def edit
    @politica_proveedor = PoliticaProveedor.find(params[:id])
  end

  # POST /politicas_proveedor
  # POST /politicas_proveedor.xml
  def create
    @politica_proveedor = PoliticaProveedor.new(params[:politica_proveedor])
    @politica_proveedor.proveedor_id = params[:proveedor_id]

    respond_to do |format|
      if @politica_proveedor.save
        flash[:notice] = 'PoliticaProveedor was successfully created.'
        format.html { redirect_to proveedor_url(@politica_proveedor.proveedor) }
        format.xml  { head :created, :location => politica_proveedor_url(@politica_proveedor) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @politica_proveedor.errors.to_xml }
      end
    end
  end

  # PUT /politicas_proveedor/1
  # PUT /politicas_proveedor/1.xml
  def update
    @politica_proveedor = PoliticaProveedor.find(params[:id])

    respond_to do |format|
      if @politica_proveedor.update_attributes(params[:politica_proveedor])
        flash[:notice] = 'PoliticaProveedor was successfully updated.'
        format.html { redirect_to proveedor_url(params[:proveedor_id]) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @politica_proveedor.errors.to_xml }
      end
    end
  end

  # DELETE /politicas_proveedor/1
  # DELETE /politicas_proveedor/1.xml
  def destroy
    @politica_proveedor = PoliticaProveedor.find(params[:id])
    @politica_proveedor.destroy

    respond_to do |format|
      format.html { redirect_to proveedor_url(params[:proveedor_id]) }
      format.xml  { head :ok }
    end
  end
end
